public class Chicken {
    //三只小鸡一块钱，一只公鸡3块钱，一只母鸡5块钱
    //100块买100之鸡，多少种买法
    //一只小鸡1/3元，设有x小鸡   y只公鸡，z只母鸡
    public static void main(String[] args) {
        int x,y,z,cost;
        for (z=0;z<=20;z++)
        {
            for (y=0;y<=33;y++) {
                x = 100 - y - z;
                if (x%3==0)
                {cost = x / 3 + 3 * y + 5 * z;
                if (cost==100)
                    System.out.println("有小鸡:"+x+" "+"有公鸡:"+y+" "+"有母鸡:"+z+" ");}
            }
        }
    }


}
